package com.vf.admin.client.dao;

import com.vf.admin.client.dto.AppTripDto;
import com.vf.admin.common.db.BaseDao;
import com.vf.admin.common.splitpage.SplitPageBean;
import com.vf.admin.miaodong.entity.AppTrip;
import com.vf.admin.miaodong.entity.AppTripComment;
import com.vf.admin.miaodong.entity.AppUser;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * <p>Title : </p>
 * <p>Description : </p>
 * <p>DevelopTools : IDEA</p>
 * <p>DevelopSystem : Windows11</p>
 *
 * @Author : zxw
 * @Date 2023/10/18 17:34
 */
@Repository
public class AppTripDao extends BaseDao<AppTrip> {


    public List<AppTripDto> getAppTripDtoPage(Map<String, Object> paraMap, SplitPageBean splitPageBean) {

        List<Object> paramList = new ArrayList<>();
        StringBuilder sbStr = new StringBuilder("");

        sbStr.append(" SELECT ap.id,ap.userid,au.tengxuncode, ap.tag, ap.voice, ap.sing, ap.score, ap.price, ap.area, ap.genius, ap.trippic, ap.createtime, au.nick,au.pic,au.sex,au.onlinestatus,ap.personnum FROM app_trip ap LEFT JOIN app_user au ON ap.userid = au.id ");
        sbStr.append(" order by ap.createtime desc");
        String sql = sbStr.toString();

        return this.queryList(sql, paramList, AppTripDto.class, splitPageBean);
    }



}
